﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Golf.Core" namespace="Golf.Core">
  <class name="Scorecard" table="tb_Scorecard" lazy="false">
    <id name="Id">
      <column name="ScorecardId" />
      <generator class="native" />
    </id>
    <many-to-one name="Course" column="CourseId" class="Course" not-null="true" foreign-key="FK_Scorecard_Course" />
    <many-to-one name="Player" column="PlayerId" class="Player" not-null="true" foreign-key="FK_Scorecard_Player" />
    <property name="Date" not-null="true" />
    <set name="Scores" table="tb_Score" lazy="false">
      <key column="ScorecardId" />
      <one-to-many class="Score" />
    </set>
  </class>
</hibernate-mapping>